package com.quectel.cms.vo.sys;

import com.quectel.constant.global.valid.ValidDivideGroupOne;
import com.quectel.sys.module.sys.dto.SysTenantDto;
import com.quectel.sys.module.sys.dto.SysUserDto;
import lombok.Builder;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: rananxin
 * @email: ryan.ran@quectel.com
 * @date: 2021/10/19 1:27 下午
 */
@Data
public class SysTenantOperateVo {

    /**
     * 租户信息
     */
    @Valid
    @NotNull(groups = ValidDivideGroupOne.class)
    private SysTenantDto sysTenant;

    /**
     * 应用包id
     */
    @NotEmpty(groups = ValidDivideGroupOne.class)
    private Long[] roleIds;

    /**
     * 管理员信息
     */
    @Valid
    @NotNull(groups = ValidDivideGroupOne.class)
    private SysUserDto sysUser;

    private List<InitResourceCls> initResources;

    public SysTenantOperateVo() {
        this.sysTenant = new SysTenantDto();
        this.roleIds = new Long[]{};
        this.sysUser = new SysUserDto();
    }

    @Data
    @Builder
    public static class InitResourceCls{
        private Long tenantId;
        private String tenantName;
        private Byte resourceType;
        private String resourceName;
        private Byte initStatus;
    }
}
